package com.airnewslinkosky.ticket.net.type;

import java.io.Serializable;

/**
 * 
 * 请求基本数据
 * @author luoxz
 *
 */
public class RequestData implements RequestMessage, Serializable {
	private static final long serialVersionUID = 91092860661953454L;
	/** AS编码 */
	private String asID;
	/** 用户优先级别 */
	private String asPriority;
	/** 时间戳，当前接口调用时间 */
	private String timeStamp;
	/** 登录密码 */
	private String userSign;
	/** 授权码 */
	private String officeSign;
	/** 操作类型 */
	private String operateType;

	//接口方法
	private String method;


	public String getAsID() {
		return asID;
	}



	public void setAsID(String asID) {
		this.asID = asID;
	}



	public String getAsPriority() {
		return asPriority;
	}



	public void setAsPriority(String asPriority) {
		this.asPriority = asPriority;
	}



	public String getTimeStamp() {
		return timeStamp;
	}



	public void setTimeStamp(String timeStamp) {
		this.timeStamp = timeStamp;
	}



	public String getUserSign() {
		return userSign;
	}



	public void setUserSign(String userSign) {
		this.userSign = userSign;
	}



	public String getOfficeSign() {
		return officeSign;
	}



	public void setOfficeSign(String officeSign) {
		this.officeSign = officeSign;
	}



	public String getOperateType() {
		return operateType;
	}



	public void setOperateType(String operateType) {
		this.operateType = operateType;
	}

	public String getMethod() {
		return method;
	}



	public void setMethod(String method) {
		this.method = method;
	}

	public String getRequestData() {
		String methodXml = "";
		if(this.method.equals("TotalOrder")){
			methodXml = "<asoc:TotalOrder>";
		} else if(this.method.equals("PassengerInfoManage")) {
			methodXml = "<PassengerInfoManage xmlns='http://COA.airnew.com'>";
		}
		StringBuffer sb = new StringBuffer();
			sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>")
			  .append("<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:asoc='http://asoc.airnews.com/'>")
			  .append("<soapenv:Header/>")
			  .append("<soapenv:Body>")
			  .append(methodXml)
			  .append("<asoc:ASID>").append(this.asID).append("</asoc:ASID>")
			  .append("<asoc:ASPriority>").append(this.asPriority).append("</asoc:ASPriority>")
			  .append("<asoc:TimeStamp>").append(this.timeStamp).append("</asoc:TimeStamp>")
			  .append("<asoc:UserSign>").append(this.userSign).append("</asoc:UserSign>")
			  .append("<asoc:OfficeSign>").append(this.officeSign).append("</asoc:OfficeSign>")
			  .append("<asoc:OperateType>").append(this.operateType).append("</asoc:OperateType>")
			  .append("</soapenv:Body>");
		return sb.toString();
	}

}
